package com.dotflat.fin.domain;

import com.dotflat.rest.domain.AreableObjectBase;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 *  收费计划
 */

@Data
@Entity
@Table(name="fin_pay_account")
@EqualsAndHashCode(callSuper = true)
public class FinPayAccount extends AreableObjectBase {

    @UpdateTimestamp
    @Column(columnDefinition = "datetime COMMENT '更新时间' ")
    private Date updatedAt;

    @Column(columnDefinition = "bit(1) default 1 COMMENT '是否启用,只能同时启用一个类型的一个'", nullable = false)
    private Boolean enabled = true;

    @Column(columnDefinition = "INT(3) default 0 COMMENT '账户类型, 0:未启用  1:微信小程序   2:支付宝  3:微信公众号'", nullable = false)
    private Integer accountType = 0;

    @Column(columnDefinition = "VARCHAR(128) COMMENT '商户名称'", nullable = false)
    private String name;

    @Column(columnDefinition = "VARCHAR(64) COMMENT 'AppId'", nullable = false)
    private String appId;

    @JsonIgnore
    @Column(columnDefinition = "VARCHAR(64) COMMENT 'AppSecret'")
    private String appSecret;

    @Column(columnDefinition = "VARCHAR(64) COMMENT '商户ID'" )
    private String mchId;

    @JsonIgnore
    @Column(columnDefinition = "VARCHAR(64) COMMENT '商户支付密钥'" )
    private String mchKey;

//    ali-pay.app.appid=2017080708075149
//    ali-pay.app.public_key=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk6cdtqmUiGfX0FOwVlvD+hkxeZaVTMh2oz+2JaaSl+FWUA1w5uaLeX0+bmav/maBwQB03bCRRnlfGByok7IM/wdgCMPMjAvXxJC4SlTcuvn0fR+7dwUjubqRZaE36NahFAdj6qz72tmRTVmpCN+IwxU/FJwj9BydkkBVu9igPj/5JMXPaijCUHt9/w87zqo0a+3exwcKibI2UVHqzbwWCKFwVLB7AvhE3CQTW+YlkSa9c90dee5DZ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mKbSOD4hM14jUKIDikPbII/f2CSU74VtMPNhGkWF90RjW3OfkZzRW7URGAo4fLuKgXu/7ltj3DngPn5gE052ld7HW+qSgJuAYOrnvtkpNAuljLVE0MOQ9be56icp7wN7QKBgESWxwVu9O08+nOpqacsCp/SUuMnjLAB7agG5GmQkzzz7wN7SHLTA4ldUKjH/SJVy0kVl0QcMUhJjH50nxn0GtFD8YlIiHb3Y4VthmyTQX057xb4SE3NMaV0rJ6dnOvDOYUjZalYCdxzGCzdzfTgc2OYpmjV7UnYbefF73yiJgkBAoGACRyL9MkBeWOwhV3umpDh12wxXjjpTpakcFNoYvbYuYr0XkAxSTa8+pJs0CrCkRyv5CXVsfvsZpEM0ScGiKVdmTIeIcztYLNXPFQtdOhfvW1Jgucb7d0ollvl3NtznAs/LhmuL5jO7x1GSegDJQt5BP5dHc+VjQhilvMTUKT+/ikCgYEAoleGzUP1V0s/NcNXnPUFkLGKnyec06NtoTrehqk3Gu5jCfOCB+O0ZOTszEF0TD50DfNU915ylxAFc1baG7bNXmU4C3VmXuIWSBfD5XUnS2iprKaN1QequkWy6lDg22gsF6BUMEx/BRTZs/04aK6FFwhq6hW67lBWq5g5rceCKso=
//    ali-pay.app.app_public_key=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp/xGatbiAn//Fhv18bFNIdotNMaAqBh6Egmi4U6fz+3fYAnSLxVhnF+qMiH+9Ee2+UZ0oYfs8aWrkmaBejswyJXjNa6/VWaN1HYuPWdkr1oBvFHEFD9SA6YeFcID82ki9c5aGhNJxBewnTo+5pPk0mB2HQpQrkY99ESomGG4eGpa608m2KJofgl4QCWS5gI5uNhUpwso6/0rXTdxiiJBe6+WSHQSJrgnPBJWom8+GDCH+b7vyR9t9GhIt7GvIqMEFdubR7TThxZJEtqtiwsDOdrP1J4tCaKgqdxvpCZ5lqFheF2NxPh736dIvrM9ZBmr6SeHRbbsKWsukHDcrV69hQIDAQAB

    @JsonIgnore
    @Column(columnDefinition = "VARCHAR(512) COMMENT '支付宝公钥'" )
    private String aliPublicKey;

    @JsonIgnore
    @Column(columnDefinition = "VARCHAR(512) COMMENT '支付宝App公钥'" )
    private String aliAppPublicKey;

    @JsonIgnore
    @Column(columnDefinition = "VARCHAR(512) COMMENT '支付宝公钥'" )
    private String aliAppPrivateKey;

}
